package pers.qianyu.module.core.domain.image.enums;

import java.util.Objects;

/**
 * @author mizzle rain
 * @date 2021-05-12 13:37
 */
public enum ImageStatusEnum {
    NOT_PASS("未通过审核", 2),
    PENDING("待审核", 1),
    NORMAL("正常", 0),
    ;

    private final String value;
    private final Integer code;

    ImageStatusEnum(String value, Integer code) {
        this.value = value;
        this.code = code;
    }


    public static String getValueFromCode(Integer code) {
        ImageStatusEnum[] values = ImageStatusEnum.values();
        for (ImageStatusEnum imageStatusEnum : values) {
            if (Objects.equals(code, imageStatusEnum.getCode())) {
                return imageStatusEnum.getValue();
            }
        }
        return "";
    }

    public String getValue() {
        return value;
    }

    public Integer getCode() {
        return code;
    }
}
